﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="ConfirmPackage.aspx.cs" Inherits="Staff_ConfirmPackage" %>

<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:UpdatePanel ID="up1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="panelScan" runat="server">
                <div style="text-align: center;">
                    <h1>Confirm your package</h1>
                    <asp:Label ID="Label1" runat="server" Text="Receipt Number:"></asp:Label>
                    <asp:TextBox ID="txtBarcode" runat="server" AutoPostBack="True" Width="496px" OnTextChanged="txtBarcode_TextChanged"></asp:TextBox>
                    <br />
                    <br />
                    <asp:Label ID="lblError" runat="server" ForeColor="Red" Text=""></asp:Label>
                    <br />
                    <br />
                    <asp:Button ID="btnCheck" runat="server" Text="Check" OnClick="btnCheck_Click" />
                </div>
            </asp:Panel>
            <br />
            <asp:Panel ID="panelInfo" runat="server" Visible="false">
                <hr />
                <div class="box_simple">
                    <h1>Sender</h1>

                    <div class="form">
                        <div class="oneline">
                            <asp:Label ID="lblSender" runat="server" Text='<%# Package.Sender %>'></asp:Label>
                        </div>
                        <div class="oneline">
                            <asp:Label ID="lblSenderLocation" runat="server" Text='<%# Package.SenderLocation %>'></asp:Label>
                        </div>
                    </div>
                </div>

                <div class="box_simple">
                    <h1>Receiver</h1>
                    <div class="oneline">
                        <asp:Label ID="lblReceiver" runat="server" Text='<%# Package.Receiver %>'></asp:Label>
                    </div>
                    <div class="oneline">
                        <asp:Label ID="lblReceiverLocation" runat="server" Text='<%# Package.ReceiverLocation %>'></asp:Label>
                    </div>
                </div>

                <div class="box_simple">
                    <div style="height: 64px; display: block;">
                        <img src="../Image/package.png" width="40px" style="float: left; margin-right: 20px;" />
                        <h1>Package Info </h1>
                    </div>



                    <div style="margin-left: 10px;">
                        <span class="name">Parcel Type:</span>
                        <asp:Label ID="lblParcelType" runat="server" Text='<%# Package.ParcelType %>'></asp:Label>

                    </div>
                    <div style="margin-left: 10px;">
                        <span class="name">Is Fragile:</span>
                        <asp:Label ID="lblFragile" runat="server" Text='<%# (Package.Fragile.HasValue && Package.Fragile.Value )? "Frigile" : "NA" %>'></asp:Label>
                    </div>

                    <div class="important">
                        <span class="name">Weight:</span>
                        <asp:Label ID="lblWeight" runat="server" Text='<%# (Package.Weight.HasValue) ? Package.Weight.Value.ToString("###.00") + " Kg" : "0 Kg" %>'></asp:Label>
                    </div>
                    <div class="important">
                        <span class="name">Price:</span>
                        <asp:Label ID="lblPrice" runat="server" Text='<%# Package.Price.HasValue ? ("$" + Package.Price.Value.ToString("###.00")) : "$0.00" %>'></asp:Label>
                    </div>
                    <hr />
                    <div style="margin-left: 10px; margin-top: 25px;">
                        <span>The package is</span><asp:Label class="important" Style="color: #00ff21" ID="lblStatus" runat="server" Text="<%# Package.Status %>"></asp:Label>
                        <br />
                        <br />

                    </div>
                    <asp:Panel ID="panelConfirm" runat="server" style="margin-left: 10px;" Visible='<%# Package.Status=="Pending" ? true : false %>'>
                        <span>Do you want to confirm it?</span>

                        <asp:Button ID="btnConfirm" runat="server" Text="Confirm Package" OnClick="btnConfirm_Click" />
                    </asp:Panel>
                </div>

                <asp:Button ID="btnEdit" runat="server" Text="Edit Package" OnClick="btnEdit_Click" Visible="false" />
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

